# -- coding: utf-8 --
# @Time : 2021/3/19--14:59
# @Author : ChinaV
# @File : P301.py

#在......上完善代码
#可以修改程序框架及变量名称
import jieba
with open("sgld.txt","r",encoding ="utf-8") as f:
    lssgld = f.readlines()

words = ''.join(lssgld)
for i in '，。：“ ’ \n':
    if i in words:
        words = words.replace(i,"")

res = jieba.lcut(words)
d = {}
for i in res:
    d[i] = d.get(i,0)+1

ls = list(d.items())                              #要理解这行代码
ls.sort(key=lambda x:x[1], reverse = True)        #要理解这行代码

for i in range(5):
    print(ls[i][0], end='、')


